﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class ab : Form
    {
        public ab()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var uid = textUserName.Text;
            var pwd = textPassWord.Text;
            var againnPwd = textAgainPassWord.Text;

            var newUid = !string.IsNullOrEmpty(uid);
            var newPwd = !string.IsNullOrEmpty(pwd);
            var newagainPwd = pwd == againnPwd;

            if (newUid && newPwd && newagainPwd)
            {
                MessageBox.Show("注册成功!");

                Form1.users.Add(uid, pwd);

                this.Close();

            }
            else
            {
                MessageBox.Show("注册失败！");
            }
        }
    }
}
